home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Answers 2002 January
/
PC Answers January 2002.7z
/
PC Answers January 2002.bin
/
graphics
/
freepixl
/
_SETUP.1
/
Fonttest.pxl
< prev
next >
Wrap
Text File
|
2000-12-23
|
5KB
|
183 lines
{ Filename : fonttest.pxl
Purpose : Skeleton file for PiXCL applications
Date : 12 may 98
Author: S.Dibbs, VYSOR Integration Inc
History:
Version : 1.0 RELEASE
Update :
Date :
--------------------------------------------------------------------------}
Initialize: {only one instance allowed}
UseCoordinates(PIXEL)
Title$ = "Using Fonts in a PiXCL Application"
WinExist(Title$,Res)
If Res = 0 Then Goto One_Instance
Beep
WinSetActive(Title$,Res)
WinShow(Title$,RESTORE,Res)
End
One_Instance:
UseCaption(Title$) {change the title}
WinLocate(Title$,472,188,970,594,Res)
UseBackground(TRANSPARENT,0,128,128)
WinShow(Title$,NOTOPMOST,Res)
DrawBackGround
DirGet(SourceDir$) {used later for library function calls}
{DragAcceptFile(ENABLE,AcceptFile)}
{AutoProgressBar(DISABLE)}
InfoMenu(REMOVE)
WaitInput(100)
SetMenu("&File",IGNORE,
"&New",CreatingFile,
"&Open",OpeningFile,
"&Save",SavingFile,
SEPARATOR,
"E&xit!",Terminate,
ENDPOPUP,
"&View",IGNORE,
"&ToolBar",ViewToolBar,
"&StatusBar",ViewStatusBar,
ENDPOPUP,
"&Information",IGNORE,
"&Concept",Concept,
"&Help",ShowAppHelp,
SEPARATOR,
"&About",About,
ENDPOPUP)
GoSub MakeToolbar
ChangeMenuItem("&ToolBar",CHECK,TBRes)
StatusWindow(ENABLE,BOTTOM,2,200,-1,0,0)
DrawStatusWinText(0,"Ready")
ChangeMenuItem("&StatusBar",CHECK,SBRes)
Wait_for_Input:
WaitInput()
Terminate:
End
Concept:
MessageBox(OK,1,INFORMATION,
"This is a skeleton of a PiXCL application. You could briefly
describe your application's function here, or provide some
basic help information.",
"PiXCL Skeleton Concept",Res)
Goto Wait_for_Input
ShowAppHelp:
{An application Help file usually has the same name as the application.}
Winhelp("test.hlp",CONTENTS,"")
Goto Wait_for_Input
About:
AboutUser("PiXCL Application Title", { or substitute Title$}
"Two lines of text goes here e.g. Application function.",
"Four Lines of additional information goes here, perhaps contact information and Web addresses")
Goto Wait_for_Input
ViewToolBar:
GetMenuStatus("&ToolBar",CHECKED,Res)
If Res = 0
GoSub MakeToolbar
ChangeMenuItem("&ToolBar",CHECK,Res)
Else
Toolbar()
ChangeMenuItem("&ToolBar",UNCHECK,Res)
Endif
Goto Wait_for_Input
ViewStatusBar:
GetMenuStatus("&StatusBar",CHECKED, Res)
If Res = 0
StatusWindow(ENABLE,BOTTOM,2,200,-1,0,0)
DrawStatusWinText(0,"Ready")
ChangeMenuItem("&StatusBar",CHECK,Res)
Else
StatusWindow(DISABLE,BOTTOM,2,200,-1,0,0)
ChangeMenuItem("&StatusBar",UNCHECK,Res)
Endif
Goto Wait_for_Input
CreatingFile:
DrawBackground
SetDrawMode(BACKGND)
Image1$ = SourceDir$ + "\1iddnext.bmp"
DrawBitmap(100,50,Image1$)
WaitInput(2000)
ReDraw
Goto Wait_for_Input
OpeningFile:
SetDrawMode(BACKGND)
UseBackGround(TRANSPARENT,255,0,0)
DrawBackground
WaitInput(1000)
SetDrawMode(FOREGND)
UseBackGround(TRANSPARENT,96,128,0)
DrawBackground
WaitInput(1000)
DrawBackgroundRegion(100,100,300,200)
SetDrawMode(BOTH)
AddFont("c:\windows\fonts\tahoma.ttf",Res)
If Res = 0 Then DrawStatusWinText(0,"AddFont failed")
If Res = 1 Then DrawStatusWinText(0,"AddFont succeeded")
UseFont("Tahoma",11,17,NOBOLD,ITALIC,NOUNDERLINE,255,255,0)
GetTextSpacing(Tspace)
Tspace += 2
DrawText(10,50,"standard spacing")
Tspace += 2
SetTextSpacing(Tspace)
DrawText(10,70,"modified spacing")
Tspace += 2
SetTextSpacing(Tspace)
DrawText(10,90,"modified spacing")
Tspace += 2
UseFont("Tahoma",15,31,NOBOLD,ITALIC,NOUNDERLINE,255,255,0)
SetTextSpacing(Tspace)
{the SetTextSpacing is required each time if the WaitInput is used}
DrawText(10,110,"modified spacing") WaitInput(200) SetTextSpacing(Tspace)
DrawText(11,110,"modified spacing") WaitInput(200) SetTextSpacing(Tspace)
DrawText(13,110,"modified spacing") WaitInput(200) SetTextSpacing(Tspace)
DrawText(14,110,"modified spacing")
Goto Wait_for_Input
SavingFile:
RemoveFont("c:\windows\fonts\tahoma.ttf",Res)
If Res = 1 Then DrawStatusWinText(0,"Font removed")
Goto Wait_for_Input
AcceptFile:
GetDragList(FileList$)
{TODO: add file list handling here, or delete this whole label handler}
Goto Wait_for_Input
{--- Style Suggestion: place all subroutines at the end of the script.}
MakeToolbar: {subroutine}
Toolbar( RAISED, PXL_SMALL,
NULL, NULL, SEPARATOR, "", Wait_for_Input,
PXL_NEW, ENABLED, STD, "Background Draw mode", CreatingFile,
PXL_OPEN, ENABLED, STD, "Loading fonts, character spacing", OpeningFile,
PXL_SAVE, ENABLED, STD, "Removing a loaded font", SavingFile,
NULL, NULL, SEPARATOR, "", Wait_for_Input,
HELPINFO, ENABLED, STD,"Show Help",ShowAppHelp)
Return